-
Notifications
You must be signed in to change notification settings - Fork 324
feat(crypto): Add support for encrypted state events to matrix-sdk-crypto
#5539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
CodSpeed Performance ReportMerging #5539 will not alter performanceComparing Summary
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, looks really good. Thanks for breaking it up for easy review.
A few comments, nits, and suggestsions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All looks good. I agree with Rich's comments, and I've added a couple of small comments and questions from me.
17818dd
to
ec54819
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5539 +/- ##
=======================================
Coverage 88.59% 88.59%
=======================================
Files 340 340
Lines 93836 93847 +11
Branches 93836 93847 +11
=======================================
+ Hits 83133 83143 +10
Misses 6572 6572
- Partials 4131 4132 +1 ☔ View full report in Codecov by Sentry. |
This commit also refactors out what would be common code between ::encrypt and ::encrypt_state to a helper ::encrypt_inner. Signed-off-by: Skye Elliot <[email protected]>
Signed-off-by: Skye Elliot <[email protected]>
Signed-off-by: Skye Elliot <[email protected]>
Modifies `OlmMachine::decrypt_room_event_inner` to call a new method `OlmMachine::verify_packed_state_key` which, if the event is a state event, verifies that the original event's state key, when unpacked, matches the state key and event type in the decrypted event content. Introduces MegolmError::StateKeyVerificationFailed and UnableToDecryptReason::StateKeyVerificationFailed which are thrown when the verification fails. Signed-off-by: Skye Elliot <[email protected]>
9ae4a3a
to
84ebbd9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM other than a few nits about comments in tests
Signed-off-by: Skye Elliot <[email protected]>
Depends on #5511, #5512 and #5523.
OutboundGroupSession::encrypt_state
.GroupSessionManager::encrypt_state
and a private helper function::encrypt_inner
.OlmMachine::encrypt_state_event
and::encrypt_state_event_raw
.OlmMachine::decrypt_room_event_inner
.